package com.woniuxy.opencv.controller;

import com.woniuxy.opencv.pojo.ParkingRecord;
import com.woniuxy.opencv.service.ParkingRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import lombok.extern.slf4j.Slf4j;

import java.util.List;

/**
 * 停车记录控制器
 */
@RestController
@RequestMapping("/parking")
@Slf4j
public class ParkingRecordController {

    @Autowired
    private ParkingRecordService parkingRecordService;

    @GetMapping("/all")
    public ResponseEntity<List<ParkingRecord>> getAllParkingRecords() {
        List<ParkingRecord> records = parkingRecordService.getAllParkingRecords();
        return ResponseEntity.ok(records);
    }
}